package com.common.utils.constant;

/**
 * 描述：
 * 数据库常量
 *
 * @author xianggj
 * @Date 2021/10/12 18:19
 **/
public final class DataBaseConstants {

    /**
     * hive的默认库
     */
    public static final String HIVE_DEFAULT_DATABASE = "default";
    /**
     * pg的默认schema
     */
    public static final String PG_DEFAULT_SCHEMANAME = "public";
    /**
     * sqlserver默认schema
     */
    public static final String SQLSERVER_DEFAULT_SCHEMANAME = "dbo";
    /**
     * hbase默认schema
     */
    public static final String HBASE_DEFAULT_SCHEMANAME = "SYSTEM";

    /**
     * hive的jdbc驱动
     */
    public static final String HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
    /**
     * pg的驱动
     */
    public static final String POSTGRESQL_DRIVER = "org.postgresql.Driver";
    /**
     * mysql的驱动
     * 升级mysql8驱动后这部分取消
     */
    @Deprecated
    public static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver";
    /**
     * mysql8的驱动
     */
    public static final String MYSQL8_DRIVER = "com.mysql.cj.jdbc.Driver";
    /**
     * Oracle的驱动
     */
    public static final String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver";
    /**
     * gbase驱动
     */
    public static final String GBASE_DRIVER = "com.gbase.jdbc.Driver";
    /**
     * neo4j驱动
     */
    public static final String NEO4J_DRIVER = "org.neo4j.jdbc.Driver";
    /**
     * db2驱动
     */
    public static final String DB2_DRIVER = "com.ibm.db2.jcc.DB2Driver";
    /**
     * 神通驱动
     */
    public static final String SHENTONG_DRIVER = "com.oscar.Driver";
    /**
     * sybase驱动
     */
    public static final String SYBASE_DRIVER = "com.sybase.jdbc4.jdbc.SybDriver";
    /**
     * SqlServer的驱动类
     */
    public static final String SQLSERVER_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    /**
     * 达梦的驱动类
     */
    public static final String DAMENG_DRIVER = "dm.jdbc.driver.DmDriver";

    /**
     * 人大金仓的驱动类
     */
    public static final String KINGBASE_DRIVER = "com.kingbase8.Driver";

    /**
     * Hbase的驱动类
     */
    public static final String HBASE_DRIVER = "org.apache.phoenix.jdbc.PhoenixDriver";

    /**
     * orcale支持的数据类型(仅记录miner支持的类型)
     */
    public static final String ORACLE_TYPES = "CHAR,NCHAR,VARCHAR,VARCHAR2,NVARCHAR2,CLOB,NCLOB,LONG,"
            + "NUMBER,BINARY_FLOAT,BINARY_DOUBLE,DATE,TIMESTAMP,BLOB,BFILE,"
            + "NUMERIC,DECIMAL,INTEGER,INT,SMALLINT,FLOAT,REAL";

    /**
     *  Mysql支持的数据类型(仅记录miner支持的类型)
     */
    public static final String MYSQL_TYPES =
            "bigint,binary,bit,blob,char,date,datetime,decimal,double,enum,float," +
                    "int,integer,longblob,longtext,mediumblob,mediumint," +
                    "mediumtext,numeric,real,set," +
                    "smallint,text,time,timestamp,tinyblob,tinyint,tinytext,varbinary,varchar,year";

    /**
     * postgresql支持的数据类型(仅记录miner支持的类型)
     */
    public static final String POSTGRESQL_TYPES =
            "bit,bool,bytea,char,cidr,date,decimal,float4,float8,inet,int2,int4," +
                    "int8,interval,macaddr,money,path,serial4,serial8,text," +
                    "time,timestamp,timestamptz,timetz,uuid,varbit,varchar,xml";

    /**
     * HIVE支持的数据类型(仅记录miner支持的类型)
     */
    public static final String HIVE_TYPES =
            "TINYINT,SMALLINT,INT,BIGINT,BOOLEAN,FLOAT,DOUBLE,STRING,BINARY,TIMESTAMP,DECIMAL";

    /**
     * sqlserver支持的类型(仅记录miner支持的类型)
     */
    public static final String SQLSERVER_TYPES =
            "bigint,binary,bit,char,date,datetime,datetime2,decimal,float,"
                    + "int,money,nchar,ntext,numeric,nvarchar,real,"
                    + "smalldatetime,smallint,smallmoney,"
                    + "text,time,timestamp,tinyintvarbinary,varchar,xml,"
                    + "nvarchar(MAX),varbinary(MAX),varchar(MAX)";

    /**
     * gbase支持的类型(仅记录miner支持的类型)
     */
    public static final String GBASE_TYPES =
            "bigint,blob,char,date,datetime,decimal,float,int,integer,longblob,longtext," +
                    "mediumblob,mediumint,mediumtext,numeric,real,smallint,text,time,timestamp," +
                    "tinyblob,tinyint,tinytext,varchar";
}
